package com.cusc.module_login.mvvm.ui;

import android.content.Intent;

import androidx.lifecycle.ViewModelProvider;

import com.cusc.module_login.BR;
import com.cusc.module_login.R;
import com.cusc.module_login.databinding.ActLoginBinding;
import com.cusc.module_login.factory.LoginViewModuleFactory;
import com.cusc.module_login.mvvm.vm.LoginViewModel;
import com.tcgroup.phone.base_core.framework.mvvm.activity.ContainerMvvmActivity;

/**
 * 作者: wangfei
 * 创建时期: 2020/3/19.
 * 包名: com.cusc.module_login
 * 类名: OSAndroidMvvm
 */
public class LoginActivity extends ContainerMvvmActivity<ActLoginBinding,LoginViewModel> {


    @Override
    public int onBindVariableId() {
        return BR.model;
    }

    @Override
    public Class<LoginViewModel> onBindViewModel() {
        return LoginViewModel.class;
    }

    @Override
    public ViewModelProvider.Factory onBindViewModelFactory() {
        return LoginViewModuleFactory.getInstance(getApplication());
    }

    @Override
    public boolean enableToolbar() {
        return false;
    }

    @Override
    public void initView() {
        super.initView();
    }

    @Override
    public void initViewObservable() {
        mViewModel.getGoPlatformEvent().observe(this, aVoid -> {
            Intent intent = new Intent(LoginActivity.this,ChoosePlatformsActivity.class);
            startActivity(intent);
        });
    }

    @Override
    public void onRetryBtnClick() { }

    @Override
    public void onBackPressedClick() {

    }

    @Override
    public int onBindLayout() {
        return R.layout.act_login;
    }

    @Override
    public Object bindLoadSir() {
        return this;
    }

}
